﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace XXX.Models.WDFT
{


    public class WDFT_MOMainReq
    {
        /// <summary>
        /// 工单号
        /// </summary>
        public string cMoCode { get; set; }
        /// <summary>
        /// 销售订单号
        /// </summary>
        public string cSoCode { get; set; }
        /// <summary>
        /// 生产日期
        /// </summary>
        public DateTime dDate { get; set; }
        /// <summary>
        /// 产品编码
        /// </summary>
        public string cInvCode { get; set; }
        /// <summary>
        /// 产品名称（需要自查）
        /// </summary>
        public string cInvName { get; set; }
        /// <summary>
        /// 生产数量
        /// </summary>
        public string dQty { get; set; }
      
        /// <summary>
        /// 制单人
        /// </summary>
        public string cMaker { get; set; }

        public List<MOItem> itemList { get; set; }
        public List<MaterialItem> materialList { get; set; }

        public void liSort()
        {
            if (itemList != null && itemList.Count > 0)
            {
                itemList.Sort((a, b) => a.cOpSeq.CompareTo(b.cOpSeq));
            }
        }
    }
    public class MaterialItem
    {
        /// <summary>
        /// 钢材编码
        /// </summary>
        public string cMaterialCode { get; set; }

        public string cMaterialFree6 { get; set; }
        /// <summary>
        /// 钢材用量
        /// </summary>
        public decimal dMaterialQty { get; set; }

        /// <summary>
        /// 钢材张数
        /// </summary>
       public decimal dNum { get; set; }
        //入库号
        public string cBatch { get; set; }
    }

    public class MOItem
    {
        /// <summary>
        /// 行号
        /// </summary>
        public int cOpSeq { get; set; }
        /// <summary>
        /// 工序组编码,最后一位代表次数，就是这个不能重复
        /// </summary>
        public string cOpCode { get; set; }
        /// <summary>
        /// 工序组名称
        /// </summary>

        public string cOpName { get; set; }
        /// <summary>
        /// 是否拼接其他部件 是否有旋压工序，和其他拼接的，1: 是，0：否
        /// </summary>
        public int bAssemble { get; set; }
        /// <summary>
        ///   拼接的产品编码
        /// </summary>
        public List<string> cInvCodeL { get; set; }
         
        /// <summary>
        /// 临时产品编码
        /// </summary>
        public string invcode { get; set; }
        /// <summary>
        /// 临时产品名称
        /// </summary>
        public string invname { get; set; }
    }

}
